package pulpfizz.pulp;

import org.jbox2d.common.Vec2;

import java.awt.geom.Point2D;
import java.util.ArrayList;
import java.util.List;

public final class CanvasPoint extends Point2D.Float
{

	public CanvasPoint()
	{
	}

	public CanvasPoint(float x, float y)
	{
		super(x, y);
	}

	public void set(double x, double y)
	{
		setLocation(x,y);
	}

	public Vec2 toVec2()
	{
		return new Vec2(x,y);
	}

	public static Vec2[] toVec2(List<CanvasPoint> points)
	{
		Vec2[] vec = new Vec2[points.size()];
		List<Vec2> list = new ArrayList<Vec2>();
		for(CanvasPoint point : points)
		{
			list.add(point.toVec2());
		}
		return vec;
	}
}
